//
//  ScoreAnalysisCollectionViewCell.m
//  Learn
//
//  Created by on 2024/4/11.
//  Copyright © 2024 迟建国. All rights reserved.
//

#import "ScoreAnalysisCollectionViewCell.h"
#import "ScoreAnalysisView.h"
#import "BarEntry.h"

@implementation ScoreAnalysisCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.layer.cornerRadius = 15;
    self.layer.masksToBounds = YES;
    
    NSMutableArray *arr = [NSMutableArray array];
    BarEntry *m1 = [[BarEntry alloc] initWithValue:45 label:@"0%-12%" color:rgba(12, 183, 108, 1)];
    BarEntry *m2 = [[BarEntry alloc] initWithValue:23 label:@"12%-21%" color:rgba(12, 183, 108, 1)];
    BarEntry *m3 = [[BarEntry alloc] initWithValue:111 label:@"19%-11%" color:rgba(12, 183, 108, 1)];
    BarEntry *m4 = [[BarEntry alloc] initWithValue:76 label:@"29%-45%" color:rgba(12, 183, 108, 1)];
    BarEntry *m5 = [[BarEntry alloc] initWithValue:23 label:@"34%-67%" color:rgba(12, 183, 108, 1)];
    BarEntry *m6 = [[BarEntry alloc] initWithValue:34 label:@"45%-59%" color:rgba(12, 183, 108, 1)];
    BarEntry *m7 = [[BarEntry alloc] initWithValue:56 label:@"59%-100%" color:rgba(12, 183, 108, 1)];
    [arr addObjectsFromArray:@[m1,m2,m3,m4,m5,m6,m7]];

    ScoreAnalysisView *scoreView = [[ScoreAnalysisView alloc] initWithFrame:CGRectMake(10, 45, SCREEN_W - 20, 265)];
    scoreView.backgroundColor = UIColor.whiteColor;
    scoreView.dataEntries = arr;
    [self addSubview:scoreView];
    // Initialization code
}

@end
